<!DOCTYPE html>
<html>
<head>
	<title>登陆</title>
	<meta content="html/text" charset='utf8'>
</head>
<body>
<div id='d1'>
</div>
<div>
	<table border="1px">
		<tr>
			<td>
				<label>用户名：</label>
			</td>
			<td>
				<input type='text' name="email" id="email"/>
			</td>
		</tr>
		<tr>
			<td>
				<label>密&nbsp;码：</label>
			</td>
			<td>
				<input type="password" name="password" id="password"/>
			</td>
		</tr>
		<tr>	
			<td></td>
			<td>
				<input type="button" id="login" value="登陆">
				<input type="button" id="register" value="注册">
				<input type="button" id="feedback" value="反馈">
			</td>
		</tr>
	</table>
	
</div>
<script type="text/javascript" src="/js/jquery-1.11.3.js"></script>
<script type="text/javascript">
$(function(){
	$("#login").click(function(){
		$.ajax({
			url:"LoginCheck",
			type:"post",
			data:{email:$("#email").val(),password:$("#password").val()},
			dataType:"json",
			success:function(data){
				if(data.status.Code==0)
				{
					window.location.replace('/RondomSystem/showUserIndex');
				}
				else if(data.status.Code==1)
				{
					window.location.replace('/RondomSystem/showAdminIndex');
				}
				else
				{
					$('#d1').html(data.status.message);
				}
			}
		});
	});
	$("#register").click(function(){
		window.location.href="/RondomSystem/showRegister";
	});
	$("#feedback").click(function(){
		window.location.href="/RondomSystem/showFeedback";
	});
});
</script>
</body>
</html>